package com.suliao.web.controller;

import com.suliao.common.annotation.LoginPass;
import com.suliao.common.base.Result;
import com.suliao.common.base.UserContext;
import com.suliao.common.util.SessionUtil;
import com.suliao.home.entity.industry.*;
import com.suliao.home.entity.product.SymbolDO;
import com.suliao.home.entity.supply.SupplyPictureDO;
import com.suliao.home.entity.sys.FileDO;
import com.suliao.home.entity.sys.UserDO;
import com.suliao.home.service.industry.*;
import com.suliao.home.service.product.SymbolService;
import com.suliao.home.service.supply.SupplyPictureService;
import com.suliao.home.service.sys.FileService;
import com.suliao.home.service.sys.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

/**
 * @author ：FeifeiYu
 * @date ：Created in 2020/12/17 14:11
 * @description：展厅相关
 * @version: 1.0
 */
@Controller
@RequestMapping(value = "/exhibitHomePage")
@LoginPass
public class ExhibitionHallController {

    /**
     * 展厅表 服务类
     */
    @Reference
    private ExhibitionShowService exhibitionShowService;


    /**
     * 企业主要信息表 服务类
     */
    @Reference
    private CompanyMainService companyMainService;


    /**
     * 展品表 服务类
     */
    @Reference
    private ExhibitService exhibitService;

    /**
     * 图文描述 服务类
     */
    @Reference
    private SupplyPictureService supplyPictureService;

    /**
     * 展厅banner 服务类
     */
    @Reference
    private ExhibitionBannerService exhibitionBannerService;

    /**
     * 用户表 服务类
     */
    @Reference
    private UserService userService;

    /**
     * 文件 服务类
     */
    @Reference
    private FileService fileService;

    /**
     * 留言表 服务类
     */
    @Reference
    private LeaveMessageService leaveMessageService;

    /**
     * 产品符号维护表 服务类
     */
    @Reference
    private SymbolService symbolService;


    @Value("${path.home.web}")
    public String home_web;

    private static String productTitle = null;
    private static String banPositionBack = null;

    /**
     * 共享工具类
     */
    @Autowired
    private SessionUtil sessionUtil;

    /**
     * 展厅首页加载展品列表
     *
     * @param mv
     * @param companyId 公司id
     * @return
     */
    @GetMapping("/loadHomePage")
    public String loadExhibitionHall(Model mv, Integer companyId) {
        try {
            //根据传递过来的公司UUID去查询展厅对应的模板值（1，2，3），用于前台展厅首页的模板展示
            ExhibitionShowDO exhibitionShow = exhibitionShowService.getExhibitionShowByCompanyId(companyId);
            //获取展厅装修的模板值、关于我们、名片二维码
            Integer exhibitStatus = null;
            String aboutUsInfo = null;
            String exhibitQRCode = null;
            if (exhibitionShow != null) {
                exhibitStatus = exhibitionShow.getExhibitionDecoration(); //展厅模板
                aboutUsInfo = exhibitionShow.getAboutUsInfo();//关于我们
                exhibitQRCode = exhibitionShow.getQrCode();//名片二维码
            }
            mv.addAttribute("productTitle", productTitle);
            mv.addAttribute("banPositionBack", banPositionBack);

            //加载 关于我们 信息
            mv.addAttribute("showAboutUs", aboutUsInfo);

            //通过公司id去获取公司名称
            CompanyMainDO companyMain = companyMainService.getCompanyById(companyId);
            String companyName = null;
            if (companyMain != null) {
                companyName = companyMain.getCompanyFullName();
            }
            mv.addAttribute("companyName", companyName);

            //通过公司id去获取该公司的拳头展品
            List<ExhibitDO> fistProductList = exhibitService.getFistProductListByCompanyId(companyId);
            List<SupplyPictureDO> fistPictureList = new ArrayList<>();

            //处理拳头展品单个字段存放多个图片url的问题
            if (fistProductList.size() > 0) {
                for (int i = 0; i < fistProductList.size(); i++) {
                    //获得产品id
                    Integer productId = fistProductList.get(i).getProductId();
                    //获得信息标题
                    String productTitle = fistProductList.get(i).getProductTitle();
                    //根据拳头展品的产品id去查询相应的图片，用于展厅首页的拳头展品展示
                    List<SupplyPictureDO> pictureList = supplyPictureService.getPictureListByProductId(productId);
                    if (pictureList.size() < 1) {
                        continue;//当前展品没有图文描述信息
                    }
                    SupplyPictureDO pictureDto = pictureList.get(0);//取第一个图片描述
                    pictureDto.setProductTitle(productTitle);
                    String picUrlStr = pictureDto.getPictureExhibition();
                    if (picUrlStr.indexOf(";") == -1) {
                        fistPictureList.add(pictureDto);
                    } else {
                        //多个图片，只展示第一个图片
                        String[] picOssUrlArr = picUrlStr.split(";");
                        pictureDto.setPictureExhibition(picOssUrlArr[0]);
                        fistPictureList.add(pictureDto);
                    }
                }
            }
            Integer fistPicNum = fistPictureList.size();
            mv.addAttribute("fistNum", fistPicNum);
            mv.addAttribute("fistPictureList", fistPictureList);

            //加载展厅产品信息
            List<SupplyPictureDO> picList = supplyPictureService.loadProductByCompanyId(companyId);

            Integer flag = 0;
            if (picList.size() > 0) {
                //处理一个字段存放多张图片的url
                for (int i = 0; i < picList.size(); i++) {
                    String picUrlStr = picList.get(i).getPictureExhibition();
                    if (picUrlStr.indexOf(";") != -1) {
                        //只展示展品的第一张图片
                        String[] picOssUrlArr = picUrlStr.split(";");
                        picList.get(i).setPictureExhibition(picOssUrlArr[0]);
                    }

                }
                flag = 1;
            } else {
                flag = 0;
            }
            mv.addAttribute("flag", flag);
            mv.addAttribute("picList", picList);

            // 获取登录人信息
            UserContext user = sessionUtil.getUserContext();
            mv.addAttribute("userinfo", user);

            //查询登录用户的塑金余额
            if (user != null) {
                Integer corpId = user.getCompanyId();
                //查询塑金余额
                String plasticGoldList = "0.00";
                if (corpId == null || corpId == 0) {
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                } else {
                    //plasticGoldList = industryExhibitorService.findAllPlasticGolds(corpId);
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                }
            }

            //判断展厅二维码是否存在于展厅表中，若存在则直接获取，若不存在，则动态生成
            String companyCodeUrl = "";
            Integer qrCodeFlag = 0;
            if (exhibitQRCode != null) {
                qrCodeFlag = 1;
            } else {
                companyCodeUrl = home_web + "exhibitHomePage/toAppCardContact?CompanyId=" + companyId;
            }
            mv.addAttribute("qrCodeFlag", qrCodeFlag);
            mv.addAttribute("QRCode", exhibitQRCode);
            mv.addAttribute("codeUrl", companyCodeUrl);

            //回显展厅标题名称
            mv.addAttribute("hallName", "展厅首页");

            // 回显头部标题
            mv.addAttribute("banName", "展厅首页");
            mv.addAttribute("CompanyId", companyId);//公司id

            if (exhibitStatus != null && exhibitStatus == 2) {
                return "exhibitHall/exhibit_homePageTwo";
            } else {
                //其他情况默认相同
                return "exhibitHall/exhibit_homepage";
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "exhibitHall/exhibit_homepage";
    }


    /**
     * 加载 关于我们 信息
     *
     * @param mv
     * @param companyId 公司id
     * @return
     */
    @GetMapping("/loadAboutUsPage")
    public String loadAboutUsPage(Model mv, Integer companyId) {
        try {
            //封装相关数据
            mv.addAttribute("productTitle", productTitle);
            mv.addAttribute("banPositionBack", banPositionBack);
            mv.addAttribute("userinfo", sessionUtil.getUserContext());
            //获取 展厅-关于我们-展厅banner 图片
            String position = "关于我们";
            List<ExhibitionBannerDO> bannerList = exhibitionBannerService.getExhibitionHallbanner(companyId, position);

            //判断banner位置的图片的数量是否为0，如果为0，则显示默认图片
            Integer flag = 0;
            if (bannerList.size() > 0) {
                flag = 1;
            } else {
                flag = 0;
            }
            //封装"关于我们"展厅banner
            mv.addAttribute("flag", flag);
            mv.addAttribute("bannerList", bannerList);

            //查询 关于我们 信息
            ExhibitionShowDO aboutUs = exhibitionShowService.getExhibitionShowByCompanyId(companyId);
            String aboutUsInfo = null;
            if (aboutUs != null) {
                aboutUsInfo = aboutUs.getAboutUsInfo();
            }
            mv.addAttribute("showAboutUs", aboutUsInfo);

            // 获取登录人信息
            UserContext user = sessionUtil.getUserContext();
            mv.addAttribute("userinfo", user);
            /*if (user != null) {
                Integer corpId = user.getCompanyId();
                //查询塑金余额
                String plasticGoldList = "0.00";
                if (corpId == null||corpId==0) {
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                } else {
                    plasticGoldList = industryExhibitorService.findAllPlasticGolds(corpId);
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                }
            }*/

            //回显展厅标题名称
            mv.addAttribute("hallName", "关于我们");

            // 回显头部标题
            mv.addAttribute("banName", "关于我们");
            mv.addAttribute("companyId", companyId);//公司id
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "exhibitHall/exhibit_aboutUs";
    }

    /**
     * 加载 联系我们 信息
     *
     * @param mv
     * @param companyId 公司id
     * @return
     */
    @GetMapping("/loadContactUsPage")
    public String loadContactUsPage(Model mv, Integer companyId) {
        try {
            //获取 展厅-联系我们-展厅banner 图片
            String position = "联系我们";
            List<ExhibitionBannerDO> bannerList = exhibitionBannerService.getExhibitionHallbanner(companyId, position);

            //判断banner位置的图片的数量是否为0，如果为0，则显示默认图片
            Integer flag = 0;
            if (bannerList.size() > 0) {
                flag = 1;
            } else {
                flag = 0;
            }
            mv.addAttribute("flag", flag);
            mv.addAttribute("bannerList", bannerList);

            //加载 关于我们 信息
            ExhibitionShowDO aboutUs = exhibitionShowService.getExhibitionShowByCompanyId(companyId);
            String contactName = null;
            Integer contactPost = 0;
            String contactLandline = null;
            Integer contactPhones = null;
            if (aboutUs == null) {
                contactName = null;
                contactPost = null;
                contactLandline = null;
                contactPhones = null;
            } else {
                //联系人
                contactName = aboutUs.getContactPerson();
                //联系人职位
                contactPost = aboutUs.getContactPost();
                //联系人座机
                contactLandline = aboutUs.getContactLandline();
                //联系人手机号
                contactPhones = aboutUs.getPhonenumber();
            }
            mv.addAttribute("contactName", contactName);
            mv.addAttribute("contactPost", contactPost);
            mv.addAttribute("contactLandline", contactLandline);
            mv.addAttribute("contactPhones", contactPhones);

            //获取登录信息
            UserContext user = sessionUtil.getUserContext();

            //小程序相关
            if (user == null) {
                mv.addAttribute("qrFlag", 0);
            } else {
                Integer corpId = user.getCompanyId();
                //通过公司id获取展品信息
                List<ExhibitDO> exhibitList = exhibitService.getExhibitListByCompanyId(corpId);
                if (exhibitList.size() == 0) {
                    //获取用户详细信息
                    UserDO userDO = userService.getUserById(user.getUserId());
                    Integer phoneNumber = userDO.getPhoneNumber();//获取手机号

                    //涉及小程序的表先不管
                    String qrCode = null;
                    //String qrCode = industryProductService.findQrcodeFromXCX(phoneNumber);

                    Integer qrFlag = 0;
                    if (qrCode != null) {
                        qrFlag = 1;
                    }
                    mv.addAttribute("qrFlag", qrFlag);
                    mv.addAttribute("qrCode", qrCode);
                } else {
                    //展品集合不为空，则获取第一个展品的联系人和联系电话
                    UserDO userDO = userService.getUserById(exhibitList.get(0).getProductContactId());
                    Integer phoneNumber = userDO.getPhoneNumber();
                    //涉及小程序的表先不管
                    String qrCode = null;
                    //String qrCode = industryProductService.findQrcodeFromXCX(phoneNumber);

                    Integer qrFlag = 0;
                    if (qrCode != null) {
                        qrFlag = 1;
                    }
                    mv.addAttribute("qrFlag", qrFlag);
                    mv.addAttribute("qrCode", qrCode);
                }
            }

            //加载 联系我们 信息(企业信息表)
            CompanyMainDO contactUs = companyMainService.getCompanyById(companyId);
            mv.addAttribute("contactUs", contactUs);

            //查询登录用户的塑金余额
            if (user != null) {
                Integer corpId = user.getCompanyId();
                //查询塑金余额
                String plasticGoldList = "0.00";
                if (corpId == null || corpId == 0) {
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                } else {
                    //plasticGoldList = industryExhibitorService.findAllPlasticGolds(corpId);
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                }
            }

            //封装相关数据
            mv.addAttribute("userinfo", user);
            mv.addAttribute("productTitle", productTitle);
            mv.addAttribute("banPositionBack", banPositionBack);

            //回显展厅标题名称
            mv.addAttribute("hallName", "联系我们");

            // 回显头部标题
            mv.addAttribute("banName", "联系我们");
            mv.addAttribute("companyId", companyId);//公司id
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "exhibitHall/exhibit_contactUs";
    }

    /**
     * 生成二维码（小程序表）
     *
     * @param contactPhones
     * @return
     */
    @PostMapping(value = "findQRCode")
    @ResponseBody
    public Result findQEcodeXCX(String contactPhones) {
        Result result = null;
        try {
            //涉及小程序的表先不管
            String qrCode = null;
            //String qrCode = industryProductService.findQrcodeFromXCX(phoneNumber);
            if (qrCode != null) {
                result = Result.ok();
                result.setData(qrCode);
            } else {
                result = Result.error(null);
            }
        } catch (Exception e) {
            result = Result.error("服务器异常！");
            e.printStackTrace();
        }
        return result;
    }

    /**
     * 加载 展厅-荣誉证书 页面
     *
     * @param mv
     * @param companyId 公司id
     * @return
     */
    @GetMapping("/loadCertificatePage")
    public String loadCertificatePage(Model mv, Integer companyId) {

        try {
            //获取 展厅-荣誉证书-展厅banner 图片
            String position = "资质展示";
            List<ExhibitionBannerDO> bannerList = exhibitionBannerService.getExhibitionHallbanner(companyId, position);
            //判断banner位置的图片的数量是否为0，如果为0，则显示默认图片
            Integer flag = 0;
            if (bannerList.size() > 0) {
                flag = 1;
            } else {
                flag = 0;
            }
            mv.addAttribute("flag", flag);
            mv.addAttribute("bannerList", bannerList);

            //获取展厅数据
            ExhibitionShowDO certificatePage = exhibitionShowService.getExhibitionShowByCompanyId(companyId);

            //获取企业资质展示图片
            String certificateInfo = null;
            if (certificatePage == null) {
                certificateInfo = null;
            } else {
                FileDO fileDO = fileService.getById(certificatePage.getQualificationImgId());
                if (fileDO != null) {
                    certificateInfo = fileDO.getFileUrl();
                }

            }
            mv.addAttribute("certificateInfo", certificateInfo);

            // 获取登录人信息
            UserContext user = sessionUtil.getUserContext();
            mv.addAttribute("userinfo", user);

            //查询登录用户的塑金余额
            if (user != null) {
                Integer corpId = user.getCompanyId();
                //查询塑金余额
                String plasticGoldList = "0.00";
                if (corpId == null || corpId == 0) {
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                } else {
                    //plasticGoldList = industryExhibitorService.findAllPlasticGolds(corpId);
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                }
            }

            //封装相关数据
            mv.addAttribute("productTitle", productTitle);
            mv.addAttribute("banPositionBack", banPositionBack);

            //回显展厅标题名称
            mv.addAttribute("hallName", "资质展示");

            // 回显头部标题
            mv.addAttribute("banName", "资质展示");
            mv.addAttribute("companyId", companyId); //公司id
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "exhibitHall/exhibit_certificate";
    }


    /**
     * 加载 展厅-留言页面
     *
     * @param mv
     * @param companyId
     * @return
     */
    @GetMapping("/leaveWord")
    public String leaveWord(Model mv, Integer companyId) {
        try {
            //获取  展厅-留言页面-展厅banner 图片
            String position = "留言中心";
            List<ExhibitionBannerDO> bannerList = exhibitionBannerService.getExhibitionHallbanner(companyId, position);
            //判断banner位置的图片的数量是否为0，如果为0，则显示默认图片
            Integer flag = 0;
            if (bannerList.size() > 0) {
                flag = 1;
            } else {
                flag = 0;
            }
            mv.addAttribute("flag", flag);
            mv.addAttribute("bannerList", bannerList);


            // 获取登录人信息
            UserContext user = sessionUtil.getUserContext();
            mv.addAttribute("userinfo", user);

            //查询登录用户的塑金余额
            if (user != null) {
                Integer corpId = user.getCompanyId();
                //查询塑金余额
                String plasticGoldList = "0.00";
                if (corpId == null || corpId == 0) {
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                } else {
                    //plasticGoldList = industryExhibitorService.findAllPlasticGolds(corpId);
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                }
            }

            //封装相关信息
            mv.addAttribute("productTitle", productTitle);
            mv.addAttribute("banPositionBack", banPositionBack);

            //回显展厅标题名称
            mv.addAttribute("hallName", "留言中心");

            // 回显头部标题
            mv.addAttribute("banName", "留言中心");
            mv.addAttribute("companyId", companyId);//公司id
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "exhibitHall/exhibit_leaveMessage";
    }

    /**
     * 添加留言信息
     */
    @PostMapping("/addLeaveWord")
    @ResponseBody
    public Result addLeaveWord(LeaveMessageDO leaveMessage) {
        Result result = null;
        try {
            //插入一条留言信息
            boolean res = leaveMessageService.save(leaveMessage);
            if (res) {
                result = Result.ok();
            } else {
                result = Result.error(null);
            }
        } catch (Exception e) {
            result = Result.error("服务器异常");
            e.printStackTrace();
        }
        return result;
    }

    /**
     * 跳转公司二维码页面
     *
     * @return
     */
    @GetMapping("/toAppCardContact")
    public String toAppCardContact(Model mv, Integer CompanyId) {
        try {
            //传递过来的公司id去查询对应的公司信息
            CompanyMainDO companyMain = companyMainService.getById(CompanyId);
            mv.addAttribute("enterInfo", companyMain);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "exhibitHall/app-cardContact";
    }

    /**
     * 通过展品id和公司id加载展厅展品详情页面
     *
     * @param mv
     * @param companyId 公司id
     * @param id        展品id
     * @return
     */
    @GetMapping("/loadExhibitDetail")
    public String loadExhibitDetail(Model mv, @RequestParam("companyId") Integer companyId, Integer id) {
        try {
            // 获取登录人信息
            UserContext user = sessionUtil.getUserContext();
            mv.addAttribute("userinfo", user);

            //通过公司id获取用户信息
            UserDO userDO = userService.getUserByCompanyId(companyId);
            //封装用户手机号
            Integer userPhone = null;
            if (userDO != null) {
                userPhone = userDO.getPhoneNumber();
            }
            mv.addAttribute("userPhone", userPhone);

            //通过展品id获取展品信息
            ExhibitDO exhibitDetail = exhibitService.getById(id);
            //封装展品信息
            mv.addAttribute("detailList", exhibitDetail);

            //通过产品id查询展品对应的图片
            List<SupplyPictureDO> pictureList = supplyPictureService.getPictureListByProductId(id);
            List<String> picturePathList = new ArrayList<>();

            //处理展品单个字段存放多个图片url的问题
            if (pictureList.size() > 0) {
                for (int i = 0; i < pictureList.size(); i++) {
                    String picUrlStr = pictureList.get(i).getPictureExhibition();
                    if (picUrlStr.indexOf(";") == -1) {
                        picturePathList.add(picUrlStr);
                    } else {
                        String[] picOssUrlArr = picUrlStr.split(";");
                        for (int j = 0; j < picOssUrlArr.length; j++) {
                            picturePathList.add(picOssUrlArr[j]);
                        }
                    }
                }
            }
            //封装展品的图文描述信息和图片路径集合
            mv.addAttribute("pictureList", picturePathList);
            mv.addAttribute("pictureDtoList", pictureList);

            //通过公司id获取展品信息
            List<ExhibitDO> exhibitList = exhibitService.getExhibitListByCompanyId(companyId);

            if (exhibitList.size() == 0) {
                //获取用户详细信息
                Integer userId = null;
                if (user != null) {
                    userId = user.getUserId();
                }
                UserDO userTemp = userService.getUserById(userId);
                Integer phoneNumber = null;
                if (userTemp != null) {
                    phoneNumber = userTemp.getPhoneNumber();//获取手机号
                }

                //涉及小程序的表先不管
                String qrCode = null;
                //String qrCode = industryProductService.findQrcodeFromXCX(phoneNumber);

                Integer qrFlag = 0;
                if (qrCode != null) {
                    qrFlag = 1;
                }
                mv.addAttribute("qrFlag", qrFlag);
                mv.addAttribute("qrCode", qrCode);
            } else {
                //展品集合不为空，则获取第一个展品的联系人和联系电话
                UserDO userTemp = userService.getUserById(exhibitList.get(0).getProductContactId());
                Integer phoneNumber = null;
                if (userTemp != null) {
                    phoneNumber = userTemp.getPhoneNumber();//获取手机号
                }
                //涉及小程序的表先不管
                String qrCode = null;
                //String qrCode = industryProductService.findQrcodeFromXCX(phoneNumber);

                Integer qrFlag = 0;
                if (qrCode != null) {
                    qrFlag = 1;
                }
                mv.addAttribute("qrFlag", qrFlag);
                mv.addAttribute("qrCode", qrCode);
            }

            //判断展厅二维码是否存在于展厅表中，若存在则直接获取，若不存在，则动态生成
            ExhibitionShowDO exhibitionShow = exhibitionShowService.getExhibitionShowByCompanyId(companyId);
            String exhibitQRCode = null;
            if (exhibitionShow != null) {
                exhibitQRCode = exhibitionShow.getQrCode();
            }
            String companyCodeUrl = "";
            Integer qrCodeFlag = 0;
            if (exhibitQRCode != null) {
                qrCodeFlag = 1;
            } else {
                companyCodeUrl = home_web+"exhibitHomePage/toAppCardContact?CompanyId=" + companyId;
            }
            mv.addAttribute("qrCodeFlag", qrCodeFlag);
            mv.addAttribute("QRCode", exhibitQRCode);
            mv.addAttribute("codeUrl", companyCodeUrl);

            //通过展品id查询对应的产品符号
            List<SymbolDO> symbolsList = symbolService.getSymbolByProdutId(id);
            mv.addAttribute("symbolsDtoList", symbolsList);

            //查询登录用户的塑金余额
            if (user != null) {
                Integer corpId = user.getCompanyId();
                //查询塑金余额
                String plasticGoldList = "0.00";
                if (corpId == null || corpId == 0) {
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                } else {
                    //plasticGoldList = industryExhibitorService.findAllPlasticGolds(corpId);
                    mv.addAttribute("plasticGoldList", plasticGoldList);
                }
            }

            //封装相关信息
            mv.addAttribute("productTitle", productTitle);
            mv.addAttribute("banPositionBack", banPositionBack);

            //回显展厅标题名称
            mv.addAttribute("hallName", "展品详情");

            // 回显头部标题
            mv.addAttribute("banName", "产品展示");
            mv.addAttribute("companyId", companyId);//公司id
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "exhibitHall/exhibit_detail2";
    }
}
